package com.jqsoft.launcher.activity.highblood;

import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.ListView;

import com.jqsoft.launcher.activity.JQActivity;
import com.jqsoft.launcher.R;


public class HBPCheckListActivity extends JQActivity implements OnClickListener{
	private ListView listview;// 列表
	private Button xinzeng_btn;
	@Override
	protected int getContentLayout() {
		// TODO Auto-generated method stub
		return R.layout.hbp_checklist_layout;
	}

	@Override
	protected void initGui() {
		listview = (ListView) findViewById(R.id.hbp_checklist_lv);
		xinzeng_btn=(Button) findViewById(R.id.xinzeng_btn);
		xinzeng_btn.setOnClickListener(HBPCheckListActivity.this);
	}

	@Override
	protected void initAction() {
		setGoBack();
		
	}

	@Override
	protected void initData() {
		setTitle("高血压患者健康检查");
		 ListAdapter adapter = new ListAdapter();
		listview.setAdapter(adapter);
	}
	
	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.xinzeng_btn:
			toNoFinish(HBPCheckDetailActivity.class);
			return;
		}
	}
	
	private class ListAdapter extends BaseAdapter {

		public int getCount() {
//			Log.d(tag, "列表的大小" + functionList.size());
//			return functionList.size();
			return 3;
		}

		public Object getItem(int position) {
//			return functionList.get(position);
			return position;
		}

		public long getItemId(int position) {

			return position;
		}

		public View getView(int position, View convertView, ViewGroup parent) {
//			ViewHolder holder;
			LayoutInflater inflater = LayoutInflater.from(act);
			if (convertView == null) {
//				holder = new ViewHolder();
				convertView = inflater.inflate(R.layout.hbp_checklist_item, null);
//				holder.iv_function_icon = (ImageView) convertView
//						.findViewById(R.id.iv_function_icon);
//				holder.tv_function_name = (TextView) convertView
//						.findViewById(R.id.tv_function_name);
//				holder.tv_function_des = (TextView) convertView
//						.findViewById(R.id.tv_function_des);
//				convertView.setTag(holder);
			} else {
//				holder = (ViewHolder) convertView.getTag();
			}

//			holder.iv_function_icon.setImageResource(functionList.get(position)
//					.getImgId());
//			holder.tv_function_name.setText(functionList.get(position)
//					.getFunctionName());
//			holder.tv_function_des.setText(functionList.get(position)
//					.getFunctionDes());

			return convertView;
		}
	}

//	static class ViewHolder {
//		ImageView iv_function_icon;
//		TextView tv_function_name, tv_function_des;
//	}
}
